<!-- 用户管理 -->
<template>
  <div class="app-container">
    <el-row :gutter="20">
      <!-- 部门树 -->

      <!-- 用户列表 -->
      <el-col :lg="24" :xs="24">
        <div class="titlel">
          <div class="titlel_box"></div>
          <div class="titlel_tt">项目汇总</div>
        </div>
        <!-- 搜索区域 -->
        <div class="container">
          <el-select v-model="value" placeholder="选择人员" size="large">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
          <el-select v-model="value" placeholder="选择年份" size="large">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
          <el-select v-model="value" placeholder="选择月份" size="large">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
          <el-button color="#003779" plain>
            <el-icon><Search /></el-icon>
            <span style="margin-left: 6px">查询</span>
          </el-button>
        </div>
        <div class="containers">
          <div class="center1">
            <div class="msgbox" v-if="false">
              <img src="/src/assets/images/Group@2x.png" alt="" />
              <span>暂无数据内容展示，选择人员后查看列表</span>
            </div>
            <el-table
              :span-method="arraySpanMethod"
              :cell-style="tableHeaderStyle1"
              :data="tableData"
              border
              style="width: 100%"
            >
              <el-table-column prop="id" align="center" fixed label="ID" width="78.75">
                <template #default="scope">
                  <div
                    style="display: flex; align-items: center; justify-content: center; width: 100%"
                    v-if="scope.$index != 6 && scope.$index != 7"
                  >
                    {{ scope.row.id }}
                  </div>
                  <div
                    style="display: flex; align-items: center; width: 100%"
                    v-if="scope.$index == 6"
                  >
                    {{ scope.row.id }}
                  </div>
                </template>
              </el-table-column>
              <el-table-column prop="id" align="center" label="一级项目" fixed width="148.12" />
              <el-table-column
                prop="ondeaty"
                align="center"
                label="二级项目"
                fixed
                width="148.12"
              />
              <el-table-column prop="ondeaty" align="center" label="10月" width="75" />
              <el-table-column prop="ondeaty" align="center" label="11月" width="75" />
              <el-table-column prop="ondeaty" align="center" label="12月" width="75" />
              <el-table-column prop="ondeaty" align="center" label="1月" width="75" />
              <el-table-column prop="ondeaty" align="center" label="2月" width="75" />
              <el-table-column prop="ondeaty" align="center" label="3月" width="75" />
              <el-table-column prop="ondeaty" align="center" label="4月" width="75" />
              <el-table-column prop="ondeaty" align="center" label="5月" width="75" />
              <el-table-column prop="ondeaty" align="center" label="6月" width="75" />
              <el-table-column prop="ondeaty" align="center" label="7月" width="75" />
              <el-table-column prop="ondeaty" align="center" label="8月" width="75" />
              <el-table-column prop="ondeaty" align="center" label="9月" width="75" />
              <el-table-column
                prop="ondeaty"
                label="一级项目总计"
                fixed="right"
                align="center"
                width="146.24"
              />
              <el-table-column
                prop="ondeaty"
                label="二级项目总计"
                fixed="right"
                align="center"
                width="146.24"
              />
            </el-table>
            <div class="yemmabox">
              <el-pagination
                :small="true"
                :pager-count="4"
                background
                layout="total, pager, next, jumper,slot"
                :total="20"
                style="position: relative"
              >
                <div class="sybox">首页</div>
                <div class="sybox1">尾页</div>
              </el-pagination>
            </div>
          </div>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script setup lang="ts">
const options = [
  {
    value: "Option1",
    label: "Option1",
  },
  {
    value: "Option2",
    label: "Option2",
  },
  {
    value: "Option3",
    label: "Option3",
  },
  {
    value: "Option4",
    label: "Option4",
  },
  {
    value: "Option5",
    label: "Option5",
  },
];

const tableData = [
  {
    id: 1,
    yijiclassname: "公共假期",
    ondeaty: 1,
    heji: 8,
  },
  {
    id: 2,
    yijiclassname: "病假",
    ondeaty: 1,
    heji: 8,
  },
  {
    id: 3,
    yijiclassname: "年假",
    ondeaty: 1,
    heji: 8,
  },
  {
    id: 4,
    yijiclassname: "丧假",
    ondeaty: 1,
    heji: 8,
  },
  {
    id: 5,
    yijiclassname: "考试假",
    ondeaty: 1,
    heji: 8,
  },
  {
    id: 6,
    yijiclassname: "额外假期",
    ondeaty: 1,
    heji: 8,
  },
  {
    id: "合计",
    ondeaty: 1,
    heji: 8,
  },
];

const rules = reactive({
  username: [{ required: true, message: "用户名不能为空", trigger: "blur" }],
  nickname: [{ required: true, message: "用户昵称不能为空", trigger: "blur" }],
  deptId: [{ required: true, message: "所属部门不能为空", trigger: "blur" }],
  roleIds: [{ required: true, message: "用户角色不能为空", trigger: "blur" }],
  email: [
    {
      pattern: /\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/,
      message: "请输入正确的邮箱地址",
      trigger: "blur",
    },
  ],
  mobile: [
    {
      pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
      message: "请输入正确的手机号码",
      trigger: "blur",
    },
  ],
});
const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => {
  if (rowIndex === 6) {
    // if (columnIndex == 15) {
    //   return [1, 2];
    // } else if (columnIndex === 16) {
    //   return [0, 0];
    // }

    if (columnIndex === 0) {
      return [1, 3];
    } else if (columnIndex === 1) {
      return [0, 0];
    } else if (columnIndex === 2) {
      return [0, 0];
    }
  }
};
function tableHeaderStyle1({ row, rowIndex, column, columnIndex }) {
  if (rowIndex == 6 || column.label == "二级项目总计" || column.label == "一级项目总计") {
    return { color: "#1D2129", "font-weight": "bold" };
  }
}
</script>
<style lang="scss" scoped>
.yemmabox {
  margin-top: 19px;
  display: flex;
  align-items: center;
  font-family:
    PingFang SC,
    PingFang SC;
  margin-bottom: 22px;
  width: 546px;
  position: relative;
  .sybox {
    width: 61px;
    height: 24px;
    border-radius: 3px 3px 3px 3px;
    border: 1px solid #86909c;
    text-align: center;
    line-height: 24px;
    font-family:
      PingFang SC,
      PingFang SC;
    font-weight: 400;
    font-size: 14px;
    color: #86909c;
    position: absolute;
    margin-left: 62px;
  }

  .sybox1 {
    width: 61px;
    height: 24px;
    border-radius: 3px 3px 3px 3px;
    border: 1px solid #86909c;
    text-align: center;
    line-height: 24px;
    font-family:
      PingFang SC,
      PingFang SC;
    font-weight: 400;
    font-size: 14px;
    color: #86909c;
    position: absolute;
    right: 153px;
  }
}
::v-deep .btn-next {
  background-color: #fff !important;
  margin-left: 70px !important;
}
.gongtotal {
  font-weight: bold;
  font-size: 14px;
  color: #003779;
  margin-right: 24px;
}
::v-deep .el-pagination.is-background .el-pager li {
  margin: 0 0px !important;
  margin-right: 14px !important;
}
::v-deep .el-pager li {
  min-width: 24px;
  height: 24px;
  margin: 0 14px;
  padding: 0 !important;
}
.msgbox {
  width: 574px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family:
    PingFang SC,
    PingFang SC;
  font-weight: 400;
  font-size: 20px;
  margin: 45px auto;
  color: #003779;
}
.msgbox img {
  width: 574px;
  height: 452px;
  margin-bottom: 50px;
}
.titlel {
  width: 100%;
  display: flex;
  align-items: center;
  .titlel_box {
    width: 4px;
    height: 23px;
    background: #003779;
    border-radius: 0px 6px 6px 0px;
  }
  .titlel_tt {
    font-family:
      PingFang SC,
      PingFang SC;
    font-weight: bold;
    font-size: 22px;
    color: #1d2129;
    margin-left: 9px;
  }
}
.containers {
  width: 100%;
  background: #ffffff;
  overflow: hidden;
  border-radius: 16px 16px 16px 16px;
  margin-top: 20px;
  padding: 0 24px;
}
::v-deep .el-table thead th {
  background: #f2f3f5 !important;
  color: #1d2129 !important;
}

.top1 {
  width: 100%;
  display: flex;
  justify-content: space-between;
}
.top1 .leftboxs {
  display: flex;
  align-items: center;
}
.leitem {
  font-family:
    PingFang SC,
    PingFang SC;
  font-weight: 400;
  font-size: 20px;
  color: #4e5969;
  position: relative;
  margin-right: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.activecolor {
  color: #055fe4 !important;
  font-weight: bold;
}
.activeboder {
  position: absolute;
  width: 56px;
  height: 3px;
  background: #055fe4;
  border-radius: 2px 2px 2px 2px;
  bottom: -10px;
}
.container {
  width: 100%;
  height: 80px;
  background: #ffffff;
  border-radius: 12px 12px 12px 12px;
  display: flex;
  margin-bottom: 20px;
  align-items: center;
  margin-top: 20px;
}
.daochubtn {
  width: 112px;
  height: 44px;
  background: #f7f8fa;
  border-radius: 6px 6px 6px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family:
    PingFang SC,
    PingFang SC;
  font-weight: 400;
  font-size: 15px;
  color: #4e5969;
}
.daochubtn img {
  width: 16px;
  height: 16px;
}
.container .el-button {
  width: 7.0625rem;
  height: 2.75rem;
  margin-left: 1.25rem;
  display: flex;
  justify-content: center;
  align-items: center;
  img {
    width: 17px;
    height: 17px;
  }
}
::v-deep .el-pagination__total {
  font-weight: bold;
  font-size: 14px;
  color: #003779;
  margin-right: 99px;
}
::v-deep .el-input__wrapper {
  background: #f7f8fa;
  box-shadow: none !important;
}
.borderline {
  width: 19px;
  height: 1px;
  background: #86909c;
  border-radius: 1px 1px 1px 1px;
}
::v-deep .el-date-editor.el-input {
  width: 156px;
  height: 44px;
  background: #f7f8fa;
  border-radius: 6px 6px 6px 6px;
}
.timebox {
  display: flex;
  align-items: center;
  margin-left: 22px;
  width: 361px;
  justify-content: space-between;
}
.el-select {
  width: 18.6875rem;
  border-radius: 6px 6px 6px 6px;
  margin-left: 20px;
  display: flex;
  align-items: center;
}
::v-deep .el-select--large .el-select__wrapper {
  width: 18.6875rem;
  height: 2.75rem;
  background: #f7f8fa;
  border-radius: 6px 6px 6px 6px;
  border: none !important;
  box-shadow: none;
}
.el-table {
  margin-top: 24px;
}
</style>
